// 登陆模块
import cModuleMgr from "../SuperMgr/cModuleMgr"
import cMountMgr from "../SuperMgr/cMountMgr"
import cEnumMds from "../Enum/cEnumMds"
import cEnumPab from "../Enum/cEnumPab"
import imgGameMd from "./eJYMTGameImgMoudle"
export default class jymtGameTabModule extends cModuleMgr {
    private imagels:imgGameMd[]=[];  //所有图标
    private imgidle:imgGameMd[]=[];  //空闲图标
    private imgshow:imgGameMd[]=[];  //展示图标
    constructor(){
        super(cEnumMds.jymtGameTabMoudle);
        this.landscapescreen();
        this.settingnode(0);
        this.setSpanel(cEnumPab.jymtGameTab);
    }

    //启动完成
    uistart(ucode:any){
        //构建图标
        for(let img=1;img<11;img++){
            for(let i=0;i<15;i++){
                let x = i % 5 + 1
                let mod:imgGameMd = new imgGameMd(img,x,ucode)
                mod.settingscreen(ucode.layoutshows);
                mod.changeStart();
                this.imagels.push(mod);
            }
        }
    }

    //构建完成
    imgfish(){
        //初始位置
        let ucode = this.getMount(this.node().uuid);
        let imges = this.imagels;
        for(let i=0;i<imges.length;i++){
            let img = imges[i];
            img.homing();
            if(i < 15){
                img.setPos(i+1);
                img.ending();
            }
        }
    }

    //扩展项
    protected extendClose():void{
        this.clearScripts();
        //清理引用
        this.imagels = [];
        this.imgidle = [];
        this.imgshow = [];
    }

    //派发项
    public dispatchs(data:msgBody) {
        let cmd = data.cmds.pop()
    }
}